package com.example.demo.controller;
/**
 * @Author Justice
 * @Date 2019/4/8 16:17
 * @Version 1.0
 */

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.example.demo.eo.UserInfo;
import com.example.demo.mapper.UserInfoMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class DbController {

  @Resource
  private UserInfoMapper userInfoMapper;

  @RequestMapping("/m")
  public Object mlist(){
    return JSON.toJSONString(userInfoMapper.selectList(null));
  }

  @RequestMapping("/n")
  public Object queryM(){
    return JSON.toJSONString(userInfoMapper.selectList(Wrappers.lambdaQuery(new UserInfo().setBalance(0))));
  }


}